<?php
namespace app\common\validate;

use think\Validate;

class Enroll extends Validate{

    protected $rule = [
        'real_name'=>'require|chs',
        'province_id'=>'require|number',
        'province_name'=>'require|chs',
        'city_id'=>'require|number',
        'city_name'=>'require|chs',
        'district_id'=>'require|number',
        'district_name'=>'require|chs',
        'mobile'=>'require|regex:\d{11}',
        'exhibition_id'=>'require|number',
        'style_ids'=>'require',
    ];

    protected $message = [
        'real_name.require'=>'姓名不能为空',
        'real_name.chs'=>'姓名必须是汉字',
        'province_id.require'=>'请选择省份',
        'province_id.number'=>'省份id错误',
        'province_name.require'=>'请选择省份',
        'province_name.chs'=>'身份名称必须汉字',
        'city_id.require'=>'请选择市',
        'city_id.number'=>'市id错误',
        'city_name.require'=>'请选择市',
        'city_name.chs'=>'市名称必须汉字',
        'district_id.require'=>'请选择区',
        'district_id.number'=>'区id错误',
        'district_name.require'=>'请选择区',
        'district_name.chs'=>'区名称必须汉字',
        'mobile.require'=>'手机不能为空',
        'mobile.regex'=>'手机格式不对',
        'exhibition.require'=>'请选择活动',
        'exhibition.number'=>'请选择活动',
        'style_ids.require'=>'请选择风格',
    ];

    protected $scene = [
        'preEnroll'=> ['real_name', 'province_id', 'province_name', 'city_id', 'city_name', 'district_id', 'district_name', 'mobile', 'exhibition_id'],
    ];

}